<!DOCTYPE html>
<html lang="zh-CN">

<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit"/>
<meta name="force-rendering" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon"/>
<title>登录MT-WMS系统</title>
</head>
<body>
  <div class="container">
    <div class="login">
      <div class="login_img">
        <img src="/static/img/index.jpg" alt style="height: 644px;"/>
      </div>
      <div class="login_form">
        <div class="box">
          <form method="POST" action="{{url_for('auth.login_api')}}">
          <img class="logo" src="/static/img/dl_logo.png" alt />
          <div class="input_box">
            <img class="icon" src="/static/img/dl_gsmc.png" alt />
            <input type="text" id="company" name="company" placeholder="公司名称"  value="{{ 'default' if test else '' }}">
          </div>
          <div class="input_box">
            <img class="icon" src="/static/img/dl_yhm.png" alt />
            <input type="text" name="code" placeholder="用户名" value="{{ 'admin' if test else '' }}">
          </div>
          <div class="input_box">
            <img class="icon" src="/static/img/dl_mm.png" alt />
            <input type="password" name="password" placeholder="登录密码" value="{{ 'admin123456' if test else '' }}">
          </div>
          <button class="btn" type="submit">登录</button>
          <center>
            <p style="margin-top:20px;font-size:12px;color:#FA6F03;">
            {%-if error%}{{error.msg}}{%-endif%}
            </p>
          </center>
          </form>
        </div>
      </div>
    </div>
  </div>
  <p style="text-align: center;color:red;font-weight: bold;" id="warn"></p>
</body>
<style lang="less">
.container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background-color: #f3f7f9;
}
.container .login {
  display: flex;
  width: 1034px;
  height: 644px;
  overflow: hidden;
  border-radius: 15px;
  box-sizing: border-box;
  box-shadow: 1px 2px 10px 1px #ccc;
}
.container .login_img {
  width: 488px;
  height: 644px;
}
.container .login_img img {
  width: 100%;
}
.container .login_form {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 546px;
  height: 100%;
  background-color: #fff;
}
.container .login_form .box {
  width: 358px;
}
.container .login_form .box .logo {
  margin-bottom: 38px;
}
.container .login_form .box .input_box {
  position: relative;
  margin-bottom: 24px;
}
.container .login_form .box .input_box .icon {
  position: absolute;
  left: 20px;
  top: 16px;
}
.container .login_form .box input {
  width: 358px;
  height: 50px;
  box-sizing: border-box;
  padding: 0 56px;
  outline: none;
  border: 1px solid #ccc;
  border-radius: 25px;
}
.container .login_form .box input:hover {
  border-color: #bbb;
}
.container .login_form .box input:focus {
  border: 2px solid #23c4fc;
}
.container .login_form .box input::-webkit-input-placeholder {
  color: #ccc;
}
.container .login_form .box .btn {
  width: 100%;
  height: 50px;
  margin-top: 60px;
  outline: none;
  color: #fff;
  border: none;
  border-radius: 25px;
  background-color: #1a35fe;
}
.container .login_form .box .btn:hover {
  background-color: #2d91fc;
}
</style>
<script type="text/javascript">
function get_browser(){
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
    var isOpera = userAgent.indexOf("Opera") > -1;
    if (isOpera) {
        return "Opera"
    }; //判断是否Opera浏览器
    if (userAgent.indexOf("Firefox") > -1) {
        return "FF";
    } //判断是否Firefox浏览器
    if (userAgent.indexOf("Chrome") > -1){
      return "Chrome";
     }
    if (userAgent.indexOf("Safari") > -1) {
        return "Safari";
    } //判断是否Safari浏览器
    if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
        return "IE";
    }; //判断是否IE浏览器
}
var br = get_browser();

if ("Chrome" == br) {
    console.log("Chrome");
}else{
  if("IE" == br){
    console.log("IE");
  }else{
    console.log(br)
  }
  document.getElementById('warn').innerHTML = '为了更好的使用体验，建议您下载Chrome浏览器登录<br>（ Chrome浏览器下载官网：<a href="https://www.google.cn/chrome/browser/desktop/index.html#eula" target="_blank" style="color:blue;">https://www.google.cn/chrome/browser/desktop/index.html#eula</a> ）';
}

document.getElementById('company').focus(); 
</script>
</html>